# Contributor: Leonardo Arena <rnalrd@alpinelinux.org>
# Maintainer:  Leonardo Arena <rnalrd@alpinelinux.org>
pkgname=perl-crypt-openssl-rsa
_pkgname=Crypt-OpenSSL-RSA
pkgver=0.31
pkgrel=4
pkgdesc="RSA encoding and decoding, using the openSSL libraries"
url="http://search.cpan.org/~perler/"
arch="all"
license="Perl Artistic GPL"
depends="perl perl-crypt-openssl-random perl-crypt-openssl-guess"
makedepends="perl-dev openssl-dev"
install=
subpackages="$pkgname-doc"
source="https://cpan.metacpan.org/authors/id/T/TO/TODDR/$_pkgname-$pkgver.tar.gz"
builddir="$srcdir"/$_pkgname-$pkgver

prepare() {
	default_prepare
	export CFLAGS=$(perl -MConfig -E 'say $Config{ccflags}')
	PERL_MM_USE_DEFAULT=1 perl Makefile.PL INSTALLDIRS=vendor
}

build() {
	cd $builddir
	export CFLAGS=$(perl -MConfig -E 'say $Config{ccflags}')
	make
}

check() {
	cd "$builddir"
	export CFLAGS=$(perl -MConfig -E 'say $Config{ccflags}')
	make test
}

package() {
	cd $builddir
	make DESTDIR="$pkgdir" install
	find "$pkgdir" \( -name perllocal.pod -o -name .packlist \) -delete
}

sha512sums="e00d25fc1d39253ea2d7d6ee478403d2b38bd9125602baf5815672fb9e81674ff58bbb47539e425526db1988ebc1a40837372cf42ffd466cb532efa2e450ccab  Crypt-OpenSSL-RSA-0.31.tar.gz"
